// Purpose : This page list all expert and show there profile
// Date    : 15 Sep, 2007
// Author  : Vinayak Singh Rathore 

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SiteManager;
using System.Data.SqlClient;
public partial class Community_ExpertBelog : System.Web.UI.Page
{
  //  char tabchar = ' ';
    protected localFunction lfunction = new localFunction();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
          //  BindTopicList();
            BindList();
        }
    }
    
/// <summary>
/// This function is use for bind datalist
/// </summary>
/// <author>Vinayak Singh Rathore</author>
/// <date>1 Oct, 2007</date>
    public void BindList()
    {
        // instance of manager class
        Manager objManager = new Manager(true,"ConnectionString");
        DataSet ds = new DataSet();
        ds = objManager.ExecuteQuery("GetBlogExpert","expert");
        if (ds.Tables[0].Rows.Count > 0)
        {
            dlistExpert.DataSource = ds.Tables[0];
            dlistExpert.DataBind();
           
        }
        else
        {
            lblMessage.Text = "No Expert Blog Exist";
            dlistExpert.DataSource = ds;
            dlistExpert.DataBind();
        }
        objManager = null;
    }
    /// <summary>
    /// public string ReturnQuiryString(string Id, string Typeid)
    /// This function return a encrypted string
    /// </summary>
    /// <author>Vinayak Singh Rathore</author>
    /// <date>15 August, 2007</date>
    /// <param name="Id"></param>
    /// <param name="Typeid"></param>
    /// <returns>encripted string</returns>
    public string ReturnQuiryString(string Id, string Typeid)
    {
        // string variable for store encrypted value
        string Identity;
        // instance of Encription class
        Encryption objEncription = new Encryption();
        Identity = Id.ToString();
        Identity += ","+Typeid.ToString();
       return objEncription.QueryStringEncode(Identity);
    }

    //// CODE FOR TOPICS SECTION ADDED ON 3rd DEC

    //public void BindTopicList()
    //{
    //    Manager objManager = new Manager(true,"ConnectionString");
    //    if (Request.QueryString["tab"] != null)
    //    {
    //        tabchar = Convert.ToChar(Request.QueryString["tab"]);

    //        dlistTopic.DataSource = objManager.ExecuteQuery("select id,Name from tbl_topics where Name like '" + tabchar + "%' and isdelete=0");
    //        dlistTopic.DataBind();
    //    }
    //    else
    //    {
    //        dlistTopic.DataSource = objManager.ExecuteQuery("select id ,Name from tbl_topics where id in (select top 10 topicid from forum order by postedon desc) and isdelete=0");
    //        dlistTopic.DataBind();
    //    }
    //    objManager = null;

    //}
    //protected void dlistTopic_ItemCommand(object source, DataListCommandEventArgs e)
    //{
    //    if (e.CommandName == "Go")
    //    {
    //        Response.Redirect("Forum.aspx?Id=" + e.CommandArgument);
    //    }
    //}

    //// TOPICS CODE ENDS
}
